package com.grad.webstudy.enums;

/**
 * @Author: zjf
 * @Date: 2020/1/18 22:17
 * @Description:
 */
public enum AliyunSmsTemplateCode {
    RESET_PASSWORD("SMS_182667610","重置密码",3),
    LOGIN_TEMPLATE("SMS_182682495","登录验证码",2),
    REGISTER_TEMPLATE("SMS_182667609","注册验证码",1),
    ;


    AliyunSmsTemplateCode(String templateCode, String message,int templateType) {
        this.templateCode = templateCode;
        this.message = message;
        this.templateType = templateType;
    }

    private int templateType;

    private String templateCode;

    private String message;

    public String getTemplateCode() {
        return templateCode;
    }

    public void setTemplateCode(String templateCode) {
        this.templateCode = templateCode;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getTemplateType() {
        return templateType;
    }

    public void setTemplateType(int templateType) {
        this.templateType = templateType;
    }

    public static String getValue(int code) {
        for (AliyunSmsTemplateCode ele : values()) {
            if(ele.getTemplateType()==code)
                return ele.getTemplateCode();
        }
        return null;
    }
}
